package com.sudichina.sudichina.view.fragment;

import com.sudichina.sudichina.Contains;
import com.sudichina.sudichina.bean.CarOrder;

import java.util.ArrayList;
import java.util.List;

/**
 * Name: AllFragment
 * Action:
 * Author: liuan
 * creatTime:2017-03-08 13:17
 */

public class FinishFragment extends BaseFragemnt {
    @Override
    public CharSequence getTitle() {
        return "已完成";
    }




    @Override
    protected List<CarOrder.ContentBean> setListData(List<CarOrder.ContentBean> content) {
        ArrayList<CarOrder.ContentBean> objects = new ArrayList<>();
        /**
         * 遍历集合  找出其中的完成的订单
         */
        for (CarOrder.ContentBean contentBean :
                content) {

            String tradeStatus = contentBean.getTradeStatus();
            System.out.println("遍历:"+tradeStatus);
            if (tradeStatus.contains(Contains.WANCHENG)){
                //添加到新的集合中
                objects.add (contentBean);
            }


        }


        return objects;
    }


}

